package com.furnitur.core.mapper.product;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.furnitur.core.entity.product.Furniture;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface FurnitureMapper extends BaseMapper<Furniture> {
    Integer countByMerchantId(@Param("merchantId") Long merchantId);
    Integer countLowStock(@Param("merchantId") Long merchantId);
    @Select("SELECT COUNT(*) > 0 FROM furniture WHERE id = #{resourceId} AND merchant_id = #{merchantId}")
    boolean verifyOwnership(@Param("resourceId") Long resourceId, @Param("merchantId") Long merchantId);
} 